window.onload = function() {
    document.getElementById("message").onclick = function () {
        var a = document.querySelectorAll('dl>dd')
        for(i=0;i<3;i++){
            a[i].classList.toggle("hide")
        }
    }
    document.getElementById("superSail").onclick = function () {
        var a = document.querySelectorAll('dl>dd')
        for(i=3;i<5;i++){
            a[i].classList.toggle("hide")
        }
    }
    document.getElementById("order").onclick = function () {
        var a = document.querySelectorAll('dl>dd')
        for(i=5;i<a.length;i++){
            a[i].classList.toggle("hide")
        }
    } 

//----------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------//
    
    function queryRefuseExpress(){
        axios.get('/home/refuseExpress/refuseExpress/queryRefuseExpress',{
            params:{
            }
        }).then(function(data){
            console.log(data)
            console.log(10086)
            var list = data.data.data.data
            if(list.length == 0){
                document.getElementById("myMessage").innerHTML = ``
                document.getElementById("myMessage").innerHTML += `
                <div class="nothing">订单里空空如也，赶紧去浏览添加吧</div>
                `
            }else{
                document.getElementById("myMessage").innerHTML = `<div class="order">拒收订单</div>`
                for(let i = 0;i<list.length;i++){
                    document.getElementById("myMessage").innerHTML += `
                    <div class="orderMessage">
                        <div class="shop">${list[i].shopName}></div>
                        <div class="state">已拒收</div>
                        <div class="goodPhoto"><img src="/static/home/img/4.png"></div>
                        <div class="goodMessage">
                            <p class="title">${list[i].goodsName}</p>
                            <p class="size">手指用二孔插座版</p>
                        </div>
                        <div class="ordernumber">
                                    <p>快递单号：${list[i].orderNo}</p>
                                </div>
                        <div class="goodPrice">
                            <p class="title">￥${list[i].goodsPrice}</p>
                            <p class="size">×2</p>
                        </div>
                        <div class="price">
                            <p>总价￥${2*list[i].goodsPrice}，优惠￥${2*list[i].goodsPrice}，实付￥0</p>
                        </div>
                        <div class="operate">
                            <button onclick="receiveGood(${list[i].orderId},${pageNo})">确认收货</button>
                            <button>状态查询</button>
                            <button onclick="deleteOrderHave(${list[i].orderId},${pageNo})">取消订单</button>
                        </div>
                    </div>
                    `
                }
            }
        }).catch(function (error){
            // console.log(error) 
            document.getElementById("myMessage").innerHTML = ``
            document.getElementById("myMessage").innerHTML += `
            <div class="nothing">订单里空空如也，赶紧去浏览添加吧</div>
            `
        })
    }
    (function(){queryRefuseExpress()})();
}
//----------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------//
function closethis(){
    document.getElementById("floatContent").classList.add("hide");
}